import http from './assets/script/http'

/**
 * 快捷登录
 * @public
 * @param {LoginReq}
 * @return {res, err}
 * @tutorial <http://192.168.102.127/index.html>
 * @author Leo Yang
 */
interface LoginReq {
  userName: string, // 账号
  pwd: string, // 密码
}
const login = (req: LoginReq): any => {
  return http.post('/api/Account/Login', req)
}

/**
 * 获取所有权限
 * @public
 * @return {res, err}
 * @tutorial <http://192.168.102.127/index.html>
 * @author Leo Yang
 */
const getAllPermissions = (): any => {
  return http.get('/api/Account/GetAllPermissions')
}

export {
  login,
  getAllPermissions
}
